#include "outputwidget.h"

OutputWidget::OutputWidget(const QString & title, QWidget * parent, Qt::WindowFlags flags)
	:QDockWidget(title,parent,flags)
{
	setAllowedAreas(Qt::AllDockWidgetAreas);
	textEdit=new QTextEdit(this);
	setWidget(textEdit);
}

void OutputWidget::setText(const QString &text)
{
	textEdit->setPlainText(text);
}

void OutputWidget::appendText(const QString &text)
{
	textEdit->textCursor().movePosition(QTextCursor::End);
	textEdit->textCursor().insertText(text);
}

QString OutputWidget::getText()
{
	return textEdit->toPlainText();
}
